<table id="song-table">

  <tr id="song-table-header">
    <th>Name</th>
    <th>Length</th>
    <th>Appears On</th>
    <th>Track</th>
    <th>Year</th>
  </tr>

  <% songs.each do |version| %>

  <tr class="song-table-version">
    <td class="song-table-title"><%= link_to version.title, version %></td>

    <td class="song-table-length">
      <%=h version.length_in_mins %>
    </td>

    <td class="song-table-edition">
      <% if version.disc %>
        <%=link_to version.disc.edition.title,
           release_edition_path(version.disc.edition.release, version.disc.edition) %>
      <% else %>
      -
      <% end %>
    </td>

    <td class="song-table-track"><%=h version.track %></td>

    <td class="song-table-year">
      <% if version.disc %>
        
      <% end %>
    </td>

  </tr>

  <tr>
    <td class="song-table-credit">
      <% version.song_credits.each do |credit| %>
        <%=h credit.role %>
        <%=h (credit.details != nil)? " [" + credit.details + "]" : ""%>
        by <strong><%= link_to credit.artist.name, credit.artist %></strong>
        <br />
      <% end %>
    </td>
  </tr>

  <% end %>
</table>

